package basic5;

import java.util.Scanner;


public class J05_04 {

	public static void main(String[] args) {
		
		int sum=0;
		Scanner input=new Scanner(System.in);
		int number=input.nextInt();
//		while(number!=0){
//			sum+=number;
//			number=input.nextInt();
//		System.out.println(sum);
//		}

		
		do {
			sum+=number;
			number=input.nextInt();
		}while(number!=0);
		
			
	}

}
